<%--PARA UTILIZAR EN LA PARTE WEB--%>
<%@page import="acceso.util.UserSesion"%>
<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>         


<c:set scope="page" var="active" value="false"></c:set>


    <ul id="ja-cssmenu" class="clearfix">
    <c:forEach items="${menu}" var="m" varStatus="ix">

        <c:choose>
            <c:when test="${sessionScope.contador_menu == '' || sessionScope.contador_menu == null}">
                <c:set scope="session" var="contador_menu" value="0"></c:set>
            </c:when>
            <c:otherwise>
                <c:set scope="session" var="contador_menu" value="${sessionScope.contador_menu+1}"></c:set>
            </c:otherwise>
        </c:choose>

        <c:choose>
            <c:when test="${param.primer_llamado=='true'}">
                <c:if test="${m['class'].name == 'acceso.login.Item'}">
                    <!--<li class="${(ix.count == 1)?'active':''}">-->
                    <li class="" id="rankana1_menu">
                        <c:set scope="page" var="active" value="true"/>
                    </c:if>
                    <c:if test="${ix.count > 1}">
                        <c:set scope="page" var="active" value="false"/>
                    </c:if>
                    <c:if test="${m['class'].name == 'acceso.login.Menu'}">
                    <li class="havechild">
                        <c:set scope="page" var="menu2" value="false"/>
                    </c:if>

                </c:when>
                <c:otherwise>
                <li class="${(m['class'].name == 'acceso.login.Menu')?'havesubchild':''}">

                </c:otherwise>
            </c:choose>


            <c:choose>
                <c:when test="${m['class'].name == 'acceso.login.Item'}">
                    <c:if test="${sessionScope.contador_menu == 1}">
                        <a href="${m.url}" id="menu${sessionScope.contador_menu}" uri="${m.url}" level="menu${(param.menu_padre != '')?param.menu_padre:sessionScope.contador_menu}" onclick="item_activo('menu${(param.menu_padre != '')?param.menu_padre:sessionScope.contador_menu}')" title="${m.descripcion}" target="${m.target}" style="padding-left:0px;" >
                            <img width="107px" height="20px" src="${pageContext.request.contextPath}/system/imagenes/${fn:toLowerCase(CFG.no_system)}/logo_menu.png" style="margin:5px 0px 2px" >
                        </a>
                    </c:if>
                    <c:if test="${sessionScope.contador_menu > 1}">
                        <a href="${m.url}" id="menu${sessionScope.contador_menu}" level="menu${(param.menu_padre != '')?param.menu_padre:sessionScope.contador_menu}" title="${m.descripcion}" class="${active?'active':''}" target="${m.target}" >
                            <span class="menu-title">${m.descripcion}</span>
                        </a>
                    </c:if>
                </c:when>
                <c:otherwise>
                    <a href="#" id="menu${sessionScope.contador_menu}" title="${m.descripcion}">
                        ${m.descripcion}
                    </a>
                    <c:set scope="request" var="menu" value="${m.menus}"></c:set>
                    <jsp:include page="menu.jsp?menu_padre=${(param.menu_padre != '' && param.menu_padre != null)?param.menu_padre:sessionScope.contador_menu}&primer_llamado=false"></jsp:include>
                </c:otherwise>
            </c:choose>
        </li>

    </c:forEach>
</ul>
